<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - id:000977,sync:fuzzer2,src:001052.lcov_info_final - src/emitterstate.cpp</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../index.html">top level</a> - <a href="index.html">src</a> - emitterstate.cpp<span style="font-size: 80%;"> (source / <a href="emitterstate.cpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">id:000977,sync:fuzzer2,src:001052.lcov_info_final</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">129</td>
            <td class="headerCovTableEntry">188</td>
            <td class="headerCovTableEntryLo">68.6 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2016-03-13 10:42:47</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">28</td>
            <td class="headerCovTableEntry">37</td>
            <td class="headerCovTableEntryMed">75.7 %</td>
          </tr>
          <tr><td><img src="../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : #include &lt;limits&gt;</a>
<span class="lineNum">       2 </span>            : 
<span class="lineNum">       3 </span>            : #include &quot;emitterstate.h&quot;
<span class="lineNum">       4 </span>            : #include &quot;yaml-cpp/exceptions.h&quot;  // IWYU pragma: keep
<a name="5"><span class="lineNum">       5 </span>            : </a>
<span class="lineNum">       6 </span>            : namespace YAML {
<span class="lineNum">       7 </span><span class="lineCov">       1081 : EmitterState::EmitterState()</span>
<span class="lineNum">       8 </span>            :     : m_isGood(true),
<span class="lineNum">       9 </span>            :       m_curIndent(0),
<span class="lineNum">      10 </span>            :       m_hasAnchor(false),
<span class="lineNum">      11 </span>            :       m_hasTag(false),
<span class="lineNum">      12 </span>            :       m_hasNonContent(false),
<span class="lineNum">      13 </span><span class="lineCov">       1081 :       m_docCount(0) {</span>
<span class="lineNum">      14 </span>            :   // set default global manipulators
<span class="lineNum">      15 </span><span class="lineCov">       1081 :   m_charset.set(EmitNonAscii);</span>
<span class="lineNum">      16 </span><span class="lineCov">       1081 :   m_strFmt.set(Auto);</span>
<span class="lineNum">      17 </span><span class="lineCov">       1081 :   m_boolFmt.set(TrueFalseBool);</span>
<span class="lineNum">      18 </span><span class="lineCov">       1081 :   m_boolLengthFmt.set(LongBool);</span>
<span class="lineNum">      19 </span><span class="lineCov">       1081 :   m_boolCaseFmt.set(LowerCase);</span>
<span class="lineNum">      20 </span><span class="lineCov">       1081 :   m_intFmt.set(Dec);</span>
<span class="lineNum">      21 </span><span class="lineCov">       1081 :   m_indent.set(2);</span>
<span class="lineNum">      22 </span><span class="lineCov">       1081 :   m_preCommentIndent.set(2);</span>
<span class="lineNum">      23 </span><span class="lineCov">       1081 :   m_postCommentIndent.set(1);</span>
<span class="lineNum">      24 </span><span class="lineCov">       1081 :   m_seqFmt.set(Block);</span>
<span class="lineNum">      25 </span><span class="lineCov">       1081 :   m_mapFmt.set(Block);</span>
<span class="lineNum">      26 </span><span class="lineCov">       1081 :   m_mapKeyFmt.set(Auto);</span>
<span class="lineNum">      27 </span><span class="lineCov">       1081 :   m_floatPrecision.set(std::numeric_limits&lt;float&gt;::digits10 + 1);</span>
<span class="lineNum">      28 </span><span class="lineCov">       1081 :   m_doublePrecision.set(std::numeric_limits&lt;double&gt;::digits10 + 1);</span>
<a name="29"><span class="lineNum">      29 </span><span class="lineCov">       1081 : }</span></a>
<span class="lineNum">      30 </span>            : 
<span class="lineNum">      31 </span><span class="lineCov">       1081 : EmitterState::~EmitterState() {}</span>
<span class="lineNum">      32 </span>            : 
<span class="lineNum">      33 </span>            : // SetLocalValue
<a name="34"><span class="lineNum">      34 </span>            : // . We blindly tries to set all possible formatters to this value</a>
<span class="lineNum">      35 </span>            : // . Only the ones that make sense will be accepted
<span class="lineNum">      36 </span><span class="lineCov">      17239 : void EmitterState::SetLocalValue(EMITTER_MANIP value) {</span>
<span class="lineNum">      37 </span><span class="lineCov">      17239 :   SetOutputCharset(value, FmtScope::Local);</span>
<span class="lineNum">      38 </span><span class="lineCov">      17239 :   SetStringFormat(value, FmtScope::Local);</span>
<span class="lineNum">      39 </span><span class="lineCov">      17239 :   SetBoolFormat(value, FmtScope::Local);</span>
<span class="lineNum">      40 </span><span class="lineCov">      17239 :   SetBoolCaseFormat(value, FmtScope::Local);</span>
<span class="lineNum">      41 </span><span class="lineCov">      17239 :   SetBoolLengthFormat(value, FmtScope::Local);</span>
<span class="lineNum">      42 </span><span class="lineCov">      17239 :   SetIntFormat(value, FmtScope::Local);</span>
<span class="lineNum">      43 </span><span class="lineCov">      17239 :   SetFlowType(GroupType::Seq, value, FmtScope::Local);</span>
<span class="lineNum">      44 </span><span class="lineCov">      17239 :   SetFlowType(GroupType::Map, value, FmtScope::Local);</span>
<span class="lineNum">      45 </span><span class="lineCov">      17239 :   SetMapKeyFormat(value, FmtScope::Local);</span>
<a name="46"><span class="lineNum">      46 </span><span class="lineCov">      17239 : }</span></a>
<span class="lineNum">      47 </span>            : 
<a name="48"><span class="lineNum">      48 </span><span class="lineCov">        959 : void EmitterState::SetAnchor() { m_hasAnchor = true; }</span></a>
<span class="lineNum">      49 </span>            : 
<a name="50"><span class="lineNum">      50 </span><span class="lineCov">       3141 : void EmitterState::SetTag() { m_hasTag = true; }</span></a>
<span class="lineNum">      51 </span>            : 
<a name="52"><span class="lineNum">      52 </span><span class="lineNoCov">          0 : void EmitterState::SetNonContent() { m_hasNonContent = true; }</span></a>
<span class="lineNum">      53 </span>            : 
<span class="lineNum">      54 </span><span class="lineCov">       7432 : void EmitterState::SetLongKey() {</span>
<span class="lineNum">      55 </span><span class="lineCov">       7432 :   assert(!m_groups.empty());</span>
<span class="lineNum">      56 </span><span class="lineCov">       7432 :   if (m_groups.empty())</span>
<span class="lineNum">      57 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">      58 </span>            : 
<span class="lineNum">      59 </span><span class="lineCov">       7432 :   assert(m_groups.top().type == GroupType::Map);</span>
<span class="lineNum">      60 </span><span class="lineCov">       7432 :   m_groups.top().longKey = true;</span>
<a name="61"><span class="lineNum">      61 </span>            : }</a>
<span class="lineNum">      62 </span>            : 
<span class="lineNum">      63 </span><span class="lineCov">        352 : void EmitterState::ForceFlow() {</span>
<span class="lineNum">      64 </span><span class="lineCov">        352 :   assert(!m_groups.empty());</span>
<span class="lineNum">      65 </span><span class="lineCov">        352 :   if (m_groups.empty())</span>
<span class="lineNum">      66 </span><span class="lineNoCov">          0 :     return;</span>
<span class="lineNum">      67 </span>            : 
<span class="lineNum">      68 </span><span class="lineCov">        352 :   m_groups.top().flowType = FlowType::Flow;</span>
<a name="69"><span class="lineNum">      69 </span>            : }</a>
<span class="lineNum">      70 </span>            : 
<span class="lineNum">      71 </span><span class="lineCov">      51910 : void EmitterState::StartedNode() {</span>
<span class="lineNum">      72 </span><span class="lineCov">      51910 :   if (m_groups.empty()) {</span>
<span class="lineNum">      73 </span><span class="lineCov">        919 :     m_docCount++;</span>
<span class="lineNum">      74 </span>            :   } else {
<span class="lineNum">      75 </span><span class="lineCov">      50991 :     m_groups.top().childCount++;</span>
<span class="lineNum">      76 </span><span class="lineCov">      50991 :     if (m_groups.top().childCount % 2 == 0)</span>
<span class="lineNum">      77 </span><span class="lineCov">      22526 :       m_groups.top().longKey = false;</span>
<span class="lineNum">      78 </span>            :   }
<span class="lineNum">      79 </span>            : 
<span class="lineNum">      80 </span><span class="lineCov">      51910 :   m_hasAnchor = false;</span>
<span class="lineNum">      81 </span><span class="lineCov">      51910 :   m_hasTag = false;</span>
<span class="lineNum">      82 </span><span class="lineCov">      51910 :   m_hasNonContent = false;</span>
<a name="83"><span class="lineNum">      83 </span><span class="lineCov">      51910 : }</span></a>
<span class="lineNum">      84 </span>            : 
<span class="lineNum">      85 </span><span class="lineCov">      17385 : EmitterNodeType::value EmitterState::NextGroupType(</span>
<span class="lineNum">      86 </span>            :     GroupType::value type) const {
<span class="lineNum">      87 </span><span class="lineCov">      17385 :   if (type == GroupType::Seq) {</span>
<span class="lineNum">      88 </span><span class="lineCov">       6261 :     if (GetFlowType(type) == Block)</span>
<span class="lineNum">      89 </span><span class="lineCov">       5862 :       return EmitterNodeType::BlockSeq;</span>
<span class="lineNum">      90 </span>            :     else
<span class="lineNum">      91 </span><span class="lineCov">        399 :       return EmitterNodeType::FlowSeq;</span>
<span class="lineNum">      92 </span>            :   } else {
<span class="lineNum">      93 </span><span class="lineCov">      11124 :     if (GetFlowType(type) == Block)</span>
<span class="lineNum">      94 </span><span class="lineCov">      10610 :       return EmitterNodeType::BlockMap;</span>
<span class="lineNum">      95 </span>            :     else
<span class="lineNum">      96 </span><span class="lineCov">        514 :       return EmitterNodeType::FlowMap;</span>
<span class="lineNum">      97 </span>            :   }
<span class="lineNum">      98 </span>            : 
<span class="lineNum">      99 </span>            :   // can't happen
<span class="lineNum">     100 </span>            :   assert(false);
<span class="lineNum">     101 </span>            :   return EmitterNodeType::NoType;
<a name="102"><span class="lineNum">     102 </span>            : }</a>
<span class="lineNum">     103 </span>            : 
<span class="lineNum">     104 </span><span class="lineNoCov">          0 : void EmitterState::StartedDoc() {</span>
<span class="lineNum">     105 </span><span class="lineNoCov">          0 :   m_hasAnchor = false;</span>
<span class="lineNum">     106 </span><span class="lineNoCov">          0 :   m_hasTag = false;</span>
<span class="lineNum">     107 </span><span class="lineNoCov">          0 :   m_hasNonContent = false;</span>
<a name="108"><span class="lineNum">     108 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     109 </span>            : 
<span class="lineNum">     110 </span><span class="lineNoCov">          0 : void EmitterState::EndedDoc() {</span>
<span class="lineNum">     111 </span><span class="lineNoCov">          0 :   m_hasAnchor = false;</span>
<span class="lineNum">     112 </span><span class="lineNoCov">          0 :   m_hasTag = false;</span>
<span class="lineNum">     113 </span><span class="lineNoCov">          0 :   m_hasNonContent = false;</span>
<a name="114"><span class="lineNum">     114 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     115 </span>            : 
<span class="lineNum">     116 </span><span class="lineCov">      34525 : void EmitterState::StartedScalar() {</span>
<span class="lineNum">     117 </span><span class="lineCov">      34525 :   StartedNode();</span>
<span class="lineNum">     118 </span><span class="lineCov">      34525 :   ClearModifiedSettings();</span>
<a name="119"><span class="lineNum">     119 </span><span class="lineCov">      34525 : }</span></a>
<span class="lineNum">     120 </span>            : 
<span class="lineNum">     121 </span><span class="lineCov">      17385 : void EmitterState::StartedGroup(GroupType::value type) {</span>
<span class="lineNum">     122 </span><span class="lineCov">      17385 :   StartedNode();</span>
<span class="lineNum">     123 </span>            : 
<span class="lineNum">     124 </span><span class="lineCov">      17385 :   const int lastGroupIndent = (m_groups.empty() ? 0 : m_groups.top().indent);</span>
<span class="lineNum">     125 </span><span class="lineCov">      17385 :   m_curIndent += lastGroupIndent;</span>
<span class="lineNum">     126 </span>            : 
<span class="lineNum">     127 </span>            :   // TODO: Create move constructors for settings types to simplify transfer
<span class="lineNum">     128 </span><span class="lineCov">      34770 :   std::unique_ptr&lt;Group&gt; pGroup(new Group(type));</span>
<span class="lineNum">     129 </span>            : 
<span class="lineNum">     130 </span>            :   // transfer settings (which last until this group is done)
<span class="lineNum">     131 </span>            :   //
<span class="lineNum">     132 </span>            :   // NB: if pGroup-&gt;modifiedSettings == m_modifiedSettings,
<span class="lineNum">     133 </span>            :   // m_modifiedSettings is not changed!
<span class="lineNum">     134 </span><span class="lineCov">      17385 :   pGroup-&gt;modifiedSettings = std::move(m_modifiedSettings);</span>
<span class="lineNum">     135 </span>            : 
<span class="lineNum">     136 </span>            :   // set up group
<span class="lineNum">     137 </span><span class="lineCov">      17385 :   if (GetFlowType(type) == Block)</span>
<span class="lineNum">     138 </span><span class="lineCov">      16472 :     pGroup-&gt;flowType = FlowType::Block;</span>
<span class="lineNum">     139 </span>            :   else
<span class="lineNum">     140 </span><span class="lineCov">        913 :     pGroup-&gt;flowType = FlowType::Flow;</span>
<span class="lineNum">     141 </span><span class="lineCov">      17385 :   pGroup-&gt;indent = GetIndent();</span>
<span class="lineNum">     142 </span>            : 
<span class="lineNum">     143 </span><span class="lineCov">      17385 :   m_groups.push(std::move(pGroup));</span>
<a name="144"><span class="lineNum">     144 </span><span class="lineCov">      17385 : }</span></a>
<span class="lineNum">     145 </span>            : 
<span class="lineNum">     146 </span><span class="lineCov">      17321 : void EmitterState::EndedGroup(GroupType::value type) {</span>
<span class="lineNum">     147 </span><span class="lineCov">      17321 :   if (m_groups.empty()) {</span>
<span class="lineNum">     148 </span><span class="lineNoCov">          0 :     if (type == GroupType::Seq)</span>
<span class="lineNum">     149 </span><span class="lineNoCov">          0 :       return SetError(ErrorMsg::UNEXPECTED_END_SEQ);</span>
<span class="lineNum">     150 </span>            :     else
<span class="lineNum">     151 </span><span class="lineNoCov">          0 :       return SetError(ErrorMsg::UNEXPECTED_END_MAP);</span>
<span class="lineNum">     152 </span>            :   }
<span class="lineNum">     153 </span>            : 
<span class="lineNum">     154 </span>            :   // get rid of the current group
<span class="lineNum">     155 </span>            :   {
<span class="lineNum">     156 </span><span class="lineCov">      34642 :     std::unique_ptr&lt;Group&gt; pFinishedGroup = m_groups.pop();</span>
<span class="lineNum">     157 </span><span class="lineCov">      17321 :     if (pFinishedGroup-&gt;type != type)</span>
<span class="lineNum">     158 </span><span class="lineNoCov">          0 :       return SetError(ErrorMsg::UNMATCHED_GROUP_TAG);</span>
<span class="lineNum">     159 </span>            :   }
<span class="lineNum">     160 </span>            : 
<span class="lineNum">     161 </span>            :   // reset old settings
<span class="lineNum">     162 </span><span class="lineCov">      17321 :   std::size_t lastIndent = (m_groups.empty() ? 0 : m_groups.top().indent);</span>
<span class="lineNum">     163 </span><span class="lineCov">      17321 :   assert(m_curIndent &gt;= lastIndent);</span>
<span class="lineNum">     164 </span><span class="lineCov">      17321 :   m_curIndent -= lastIndent;</span>
<span class="lineNum">     165 </span>            : 
<span class="lineNum">     166 </span>            :   // some global settings that we changed may have been overridden
<span class="lineNum">     167 </span>            :   // by a local setting we just popped, so we need to restore them
<span class="lineNum">     168 </span><span class="lineCov">      17321 :   m_globalModifiedSettings.restore();</span>
<span class="lineNum">     169 </span>            : 
<span class="lineNum">     170 </span><span class="lineCov">      17321 :   ClearModifiedSettings();</span>
<a name="171"><span class="lineNum">     171 </span>            : }</a>
<span class="lineNum">     172 </span>            : 
<span class="lineNum">     173 </span><span class="lineCov">      56056 : EmitterNodeType::value EmitterState::CurGroupNodeType() const {</span>
<span class="lineNum">     174 </span><span class="lineCov">      56056 :   if (m_groups.empty())</span>
<span class="lineNum">     175 </span><span class="lineCov">       1049 :     return EmitterNodeType::NoType;</span>
<span class="lineNum">     176 </span>            : 
<span class="lineNum">     177 </span><span class="lineCov">      55007 :   return m_groups.top().NodeType();</span>
<a name="178"><span class="lineNum">     178 </span>            : }</a>
<span class="lineNum">     179 </span>            : 
<span class="lineNum">     180 </span><span class="lineNoCov">          0 : GroupType::value EmitterState::CurGroupType() const {</span>
<span class="lineNum">     181 </span><span class="lineNoCov">          0 :   return m_groups.empty() ? GroupType::NoType : m_groups.top().type;</span>
<a name="182"><span class="lineNum">     182 </span>            : }</a>
<span class="lineNum">     183 </span>            : 
<span class="lineNum">     184 </span><span class="lineCov">      64198 : FlowType::value EmitterState::CurGroupFlowType() const {</span>
<span class="lineNum">     185 </span><span class="lineCov">      64198 :   return m_groups.empty() ? FlowType::NoType : m_groups.top().flowType;</span>
<a name="186"><span class="lineNum">     186 </span>            : }</a>
<span class="lineNum">     187 </span>            : 
<span class="lineNum">     188 </span><span class="lineCov">      22202 : int EmitterState::CurGroupIndent() const {</span>
<span class="lineNum">     189 </span><span class="lineCov">      22202 :   return m_groups.empty() ? 0 : m_groups.top().indent;</span>
<a name="190"><span class="lineNum">     190 </span>            : }</a>
<span class="lineNum">     191 </span>            : 
<span class="lineNum">     192 </span><span class="lineCov">      98827 : std::size_t EmitterState::CurGroupChildCount() const {</span>
<span class="lineNum">     193 </span><span class="lineCov">      98827 :   return m_groups.empty() ? m_docCount : m_groups.top().childCount;</span>
<a name="194"><span class="lineNum">     194 </span>            : }</a>
<span class="lineNum">     195 </span>            : 
<span class="lineNum">     196 </span><span class="lineCov">      36659 : bool EmitterState::CurGroupLongKey() const {</span>
<span class="lineNum">     197 </span><span class="lineCov">      36659 :   return m_groups.empty() ? false : m_groups.top().longKey;</span>
<a name="198"><span class="lineNum">     198 </span>            : }</a>
<span class="lineNum">     199 </span>            : 
<span class="lineNum">     200 </span><span class="lineCov">       9288 : int EmitterState::LastIndent() const {</span>
<span class="lineNum">     201 </span><span class="lineCov">       9288 :   if (m_groups.size() &lt;= 1)</span>
<span class="lineNum">     202 </span><span class="lineCov">       1070 :     return 0;</span>
<span class="lineNum">     203 </span>            : 
<span class="lineNum">     204 </span><span class="lineCov">       8218 :   return m_curIndent - m_groups.top(-1).indent;</span>
<a name="205"><span class="lineNum">     205 </span>            : }</a>
<span class="lineNum">     206 </span>            : 
<a name="207"><span class="lineNum">     207 </span><span class="lineCov">      51846 : void EmitterState::ClearModifiedSettings() { m_modifiedSettings.clear(); }</span></a>
<span class="lineNum">     208 </span>            : 
<span class="lineNum">     209 </span><span class="lineCov">      17239 : bool EmitterState::SetOutputCharset(EMITTER_MANIP value,</span>
<span class="lineNum">     210 </span>            :                                     FmtScope::value scope) {
<span class="lineNum">     211 </span><span class="lineCov">      17239 :   switch (value) {</span>
<span class="lineNum">     212 </span>            :     case EmitNonAscii:
<span class="lineNum">     213 </span>            :     case EscapeNonAscii:
<span class="lineNum">     214 </span><span class="lineNoCov">          0 :       _Set(m_charset, value, scope);</span>
<span class="lineNum">     215 </span><span class="lineNoCov">          0 :       return true;</span>
<span class="lineNum">     216 </span>            :     default:
<span class="lineNum">     217 </span><span class="lineCov">      17239 :       return false;</span>
<span class="lineNum">     218 </span>            :   }
<a name="219"><span class="lineNum">     219 </span>            : }</a>
<span class="lineNum">     220 </span>            : 
<span class="lineNum">     221 </span><span class="lineCov">      17239 : bool EmitterState::SetStringFormat(EMITTER_MANIP value, FmtScope::value scope) {</span>
<span class="lineNum">     222 </span><span class="lineCov">      17239 :   switch (value) {</span>
<span class="lineNum">     223 </span>            :     case Auto:
<span class="lineNum">     224 </span>            :     case SingleQuoted:
<span class="lineNum">     225 </span>            :     case DoubleQuoted:
<span class="lineNum">     226 </span>            :     case Literal:
<span class="lineNum">     227 </span><span class="lineNoCov">          0 :       _Set(m_strFmt, value, scope);</span>
<span class="lineNum">     228 </span><span class="lineNoCov">          0 :       return true;</span>
<span class="lineNum">     229 </span>            :     default:
<span class="lineNum">     230 </span><span class="lineCov">      17239 :       return false;</span>
<span class="lineNum">     231 </span>            :   }
<a name="232"><span class="lineNum">     232 </span>            : }</a>
<span class="lineNum">     233 </span>            : 
<span class="lineNum">     234 </span><span class="lineCov">      17239 : bool EmitterState::SetBoolFormat(EMITTER_MANIP value, FmtScope::value scope) {</span>
<span class="lineNum">     235 </span><span class="lineCov">      17239 :   switch (value) {</span>
<span class="lineNum">     236 </span>            :     case OnOffBool:
<span class="lineNum">     237 </span>            :     case TrueFalseBool:
<span class="lineNum">     238 </span>            :     case YesNoBool:
<span class="lineNum">     239 </span><span class="lineNoCov">          0 :       _Set(m_boolFmt, value, scope);</span>
<span class="lineNum">     240 </span><span class="lineNoCov">          0 :       return true;</span>
<span class="lineNum">     241 </span>            :     default:
<span class="lineNum">     242 </span><span class="lineCov">      17239 :       return false;</span>
<span class="lineNum">     243 </span>            :   }
<a name="244"><span class="lineNum">     244 </span>            : }</a>
<span class="lineNum">     245 </span>            : 
<span class="lineNum">     246 </span><span class="lineCov">      17239 : bool EmitterState::SetBoolLengthFormat(EMITTER_MANIP value,</span>
<span class="lineNum">     247 </span>            :                                        FmtScope::value scope) {
<span class="lineNum">     248 </span><span class="lineCov">      17239 :   switch (value) {</span>
<span class="lineNum">     249 </span>            :     case LongBool:
<span class="lineNum">     250 </span>            :     case ShortBool:
<span class="lineNum">     251 </span><span class="lineNoCov">          0 :       _Set(m_boolLengthFmt, value, scope);</span>
<span class="lineNum">     252 </span><span class="lineNoCov">          0 :       return true;</span>
<span class="lineNum">     253 </span>            :     default:
<span class="lineNum">     254 </span><span class="lineCov">      17239 :       return false;</span>
<span class="lineNum">     255 </span>            :   }
<a name="256"><span class="lineNum">     256 </span>            : }</a>
<span class="lineNum">     257 </span>            : 
<span class="lineNum">     258 </span><span class="lineCov">      17239 : bool EmitterState::SetBoolCaseFormat(EMITTER_MANIP value,</span>
<span class="lineNum">     259 </span>            :                                      FmtScope::value scope) {
<span class="lineNum">     260 </span><span class="lineCov">      17239 :   switch (value) {</span>
<span class="lineNum">     261 </span>            :     case UpperCase:
<span class="lineNum">     262 </span>            :     case LowerCase:
<span class="lineNum">     263 </span>            :     case CamelCase:
<span class="lineNum">     264 </span><span class="lineNoCov">          0 :       _Set(m_boolCaseFmt, value, scope);</span>
<span class="lineNum">     265 </span><span class="lineNoCov">          0 :       return true;</span>
<span class="lineNum">     266 </span>            :     default:
<span class="lineNum">     267 </span><span class="lineCov">      17239 :       return false;</span>
<span class="lineNum">     268 </span>            :   }
<a name="269"><span class="lineNum">     269 </span>            : }</a>
<span class="lineNum">     270 </span>            : 
<span class="lineNum">     271 </span><span class="lineCov">      17239 : bool EmitterState::SetIntFormat(EMITTER_MANIP value, FmtScope::value scope) {</span>
<span class="lineNum">     272 </span><span class="lineCov">      17239 :   switch (value) {</span>
<span class="lineNum">     273 </span>            :     case Dec:
<span class="lineNum">     274 </span>            :     case Hex:
<span class="lineNum">     275 </span>            :     case Oct:
<span class="lineNum">     276 </span><span class="lineNoCov">          0 :       _Set(m_intFmt, value, scope);</span>
<span class="lineNum">     277 </span><span class="lineNoCov">          0 :       return true;</span>
<span class="lineNum">     278 </span>            :     default:
<span class="lineNum">     279 </span><span class="lineCov">      17239 :       return false;</span>
<span class="lineNum">     280 </span>            :   }
<a name="281"><span class="lineNum">     281 </span>            : }</a>
<span class="lineNum">     282 </span>            : 
<span class="lineNum">     283 </span><span class="lineNoCov">          0 : bool EmitterState::SetIndent(std::size_t value, FmtScope::value scope) {</span>
<span class="lineNum">     284 </span><span class="lineNoCov">          0 :   if (value &lt;= 1)</span>
<span class="lineNum">     285 </span><span class="lineNoCov">          0 :     return false;</span>
<span class="lineNum">     286 </span>            : 
<span class="lineNum">     287 </span><span class="lineNoCov">          0 :   _Set(m_indent, value, scope);</span>
<span class="lineNum">     288 </span><span class="lineNoCov">          0 :   return true;</span>
<a name="289"><span class="lineNum">     289 </span>            : }</a>
<span class="lineNum">     290 </span>            : 
<span class="lineNum">     291 </span><span class="lineNoCov">          0 : bool EmitterState::SetPreCommentIndent(std::size_t value,</span>
<span class="lineNum">     292 </span>            :                                        FmtScope::value scope) {
<span class="lineNum">     293 </span><span class="lineNoCov">          0 :   if (value == 0)</span>
<span class="lineNum">     294 </span><span class="lineNoCov">          0 :     return false;</span>
<span class="lineNum">     295 </span>            : 
<span class="lineNum">     296 </span><span class="lineNoCov">          0 :   _Set(m_preCommentIndent, value, scope);</span>
<span class="lineNum">     297 </span><span class="lineNoCov">          0 :   return true;</span>
<a name="298"><span class="lineNum">     298 </span>            : }</a>
<span class="lineNum">     299 </span>            : 
<span class="lineNum">     300 </span><span class="lineNoCov">          0 : bool EmitterState::SetPostCommentIndent(std::size_t value,</span>
<span class="lineNum">     301 </span>            :                                         FmtScope::value scope) {
<span class="lineNum">     302 </span><span class="lineNoCov">          0 :   if (value == 0)</span>
<span class="lineNum">     303 </span><span class="lineNoCov">          0 :     return false;</span>
<span class="lineNum">     304 </span>            : 
<span class="lineNum">     305 </span><span class="lineNoCov">          0 :   _Set(m_postCommentIndent, value, scope);</span>
<span class="lineNum">     306 </span><span class="lineNoCov">          0 :   return true;</span>
<a name="307"><span class="lineNum">     307 </span>            : }</a>
<span class="lineNum">     308 </span>            : 
<span class="lineNum">     309 </span><span class="lineCov">      34478 : bool EmitterState::SetFlowType(GroupType::value groupType, EMITTER_MANIP value,</span>
<span class="lineNum">     310 </span>            :                                FmtScope::value scope) {
<span class="lineNum">     311 </span><span class="lineCov">      34478 :   switch (value) {</span>
<span class="lineNum">     312 </span>            :     case Block:
<span class="lineNum">     313 </span>            :     case Flow:
<span class="lineNum">     314 </span><span class="lineCov">      34478 :       _Set(groupType == GroupType::Seq ? m_seqFmt : m_mapFmt, value, scope);</span>
<span class="lineNum">     315 </span><span class="lineCov">      34478 :       return true;</span>
<span class="lineNum">     316 </span>            :     default:
<span class="lineNum">     317 </span><span class="lineNoCov">          0 :       return false;</span>
<span class="lineNum">     318 </span>            :   }
<a name="319"><span class="lineNum">     319 </span>            : }</a>
<span class="lineNum">     320 </span>            : 
<span class="lineNum">     321 </span><span class="lineCov">      34770 : EMITTER_MANIP EmitterState::GetFlowType(GroupType::value groupType) const {</span>
<span class="lineNum">     322 </span>            :   // force flow style if we're currently in a flow
<span class="lineNum">     323 </span><span class="lineCov">      34770 :   if (CurGroupFlowType() == FlowType::Flow)</span>
<span class="lineNum">     324 </span><span class="lineCov">        682 :     return Flow;</span>
<span class="lineNum">     325 </span>            : 
<span class="lineNum">     326 </span>            :   // otherwise, go with what's asked of us
<span class="lineNum">     327 </span><span class="lineCov">      34088 :   return (groupType == GroupType::Seq ? m_seqFmt.get() : m_mapFmt.get());</span>
<a name="328"><span class="lineNum">     328 </span>            : }</a>
<span class="lineNum">     329 </span>            : 
<span class="lineNum">     330 </span><span class="lineCov">      17239 : bool EmitterState::SetMapKeyFormat(EMITTER_MANIP value, FmtScope::value scope) {</span>
<span class="lineNum">     331 </span><span class="lineCov">      17239 :   switch (value) {</span>
<span class="lineNum">     332 </span>            :     case Auto:
<span class="lineNum">     333 </span>            :     case LongKey:
<span class="lineNum">     334 </span><span class="lineNoCov">          0 :       _Set(m_mapKeyFmt, value, scope);</span>
<span class="lineNum">     335 </span><span class="lineNoCov">          0 :       return true;</span>
<span class="lineNum">     336 </span>            :     default:
<span class="lineNum">     337 </span><span class="lineCov">      17239 :       return false;</span>
<span class="lineNum">     338 </span>            :   }
<a name="339"><span class="lineNum">     339 </span>            : }</a>
<span class="lineNum">     340 </span>            : 
<span class="lineNum">     341 </span><span class="lineNoCov">          0 : bool EmitterState::SetFloatPrecision(int value, FmtScope::value scope) {</span>
<span class="lineNum">     342 </span><span class="lineNoCov">          0 :   if (value &lt; 0 || value &gt; std::numeric_limits&lt;float&gt;::digits10 + 1)</span>
<span class="lineNum">     343 </span><span class="lineNoCov">          0 :     return false;</span>
<span class="lineNum">     344 </span><span class="lineNoCov">          0 :   _Set(m_floatPrecision, value, scope);</span>
<span class="lineNum">     345 </span><span class="lineNoCov">          0 :   return true;</span>
<a name="346"><span class="lineNum">     346 </span>            : }</a>
<span class="lineNum">     347 </span>            : 
<span class="lineNum">     348 </span><span class="lineNoCov">          0 : bool EmitterState::SetDoublePrecision(int value, FmtScope::value scope) {</span>
<span class="lineNum">     349 </span><span class="lineNoCov">          0 :   if (value &lt; 0 || value &gt; std::numeric_limits&lt;double&gt;::digits10 + 1)</span>
<span class="lineNum">     350 </span><span class="lineNoCov">          0 :     return false;</span>
<span class="lineNum">     351 </span><span class="lineNoCov">          0 :   _Set(m_doublePrecision, value, scope);</span>
<span class="lineNum">     352 </span><span class="lineNoCov">          0 :   return true;</span>
<span class="lineNum">     353 </span>            : }
<span class="lineNum">     354 </span>            : }
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.11</a></td></tr>
  </table>
  <br>

</body>
</html>
